from selenium import webdriver
from scrapy.selector import Selector
#selenium 完成微博模拟登录
browser = webdriver.Chrome(executable_path="d:/chromedriver.exe")
browser.get("http://www.weibo.com/")
import time
time.sleep(15)
browser.find_element_by_css_selector("#loginname").send_keys("823761014@qq.com")
browser.find_element_by_css_selector(".info_list.password input[node-type='password']").send_keys("yixiaoqun@0212")
browser.find_element_by_css_selector(".info_list.login_btn a[node-type='submitBtn']").click()
#下拉
for i in range(3):
    '''三次下拉操作，这是javascript的知识'''
    browser.execute_script("window.scrollTo(0, document.body.scrollHeight); var lenOfPage=document.body.scrollHeight; return lenOfPage;")
    time.sleep(3)

#微博开放平台
#http://open.weibo.com/wiki/%E9%A6%96%E9%A1%B5

#下载地址：http://phantomjs.org/download.html